package test_achieve.admin;

import constant.Constant;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;

/**
 * Created by chenkuo on 2017/6/19.
 */
public class OrderSearch {

    @Given("^s打开订单中心$")
    public void s打开订单中心() throws Throwable {
        Constant.driverWeb.findElement(By.linkText("订单中心")).click();//点击“订单中心”
    }

    @Given("^s点击订单管理$")
    public void s点击订单管理() throws Throwable {
        Constant.driverWeb.findElement(By.linkText("订单管理")).click();//点击“订单管理”
    }

    @Given("^s切换城市到北京$")
    public void s切换城市城市到北京() throws Throwable {
        Constant.driverWeb.findElement(By.xpath("//*[@id=\"content\"]/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div[1]/div[1]/select")).click();
        WebElement city=Constant.driverWeb.findElement(By.xpath("//*[@id=\"content\"]/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div[1]/div[1]/select/option[2]"));
        city.sendKeys(Keys.ENTER);
        city.click();
    }

    @Given("^s选择日期为今天$")
    public void s选择日期为今天() throws Throwable {
    }

    @Given("^s输入订单号$")
    public void s输入订单号() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Given("^s点击搜索$")
    public void s点击搜索() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }

    @Given("^s订单被成功检索$")
    public void s订单被成功检索() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        throw new PendingException();
    }
}

